<?php

namespace app\admin\validate;

use think\Validate;
use app\common\Error;

class Subject extends Validate
{
    protected $rule = [
        'id' => 'require',
        'company_id' => 'require',
        'subject' => 'require',
        'rebate' => 'require',
    ];

    protected $message = [
        'id.require' => Error::ID_NOT_EXIXTS,
        'company_id.require' => Error::PLEASE_SELECT_COMPANY,
        'subject.require' => Error::PLEASE_WRITE_SUBJECT_NAME,
        'rebate.require' => Error::PLEASE_WRITE_SUBJECT_REBATE,
    ];

    protected $scene = [
        'add' => ['company_id', 'subject', 'rebate'],
        'edit' => ['id', 'company_id', 'subject', 'rebate'],
        'detail' => ['id'],
    ];
}